using System;
using System.Collections;
using UnityEngine;

namespace Gj
{
    public class ToastItemHelper : NodeHelper, AnimationHelper.Notice
    {
        public bool show;
        public float time;
        public AnimationHelper anim;

        public void Show()
        {
            anim.SetNotice(this);
            Invoke("Play", time);
        }

        public void Play()
        {
            anim.Forward();
        }

        public void OnStart(string key)
        {
            show = true;
            gameObject.SetActive(true);
        }

        public void OnEnd(string key)
        {
            show = false;
            gameObject.SetActive(false);
        }
    }
}